It is sometimes required to update content stored in a storage device. For example, if the content is software (such as an executable file), it is sometimes required to fix a bug in it. However, it should be noted that other types of content may also require updates, such as text, etc. Hereinafter the term “old version” refers to content before update, the term “new version” refers to the content after it was updated.
There are several ways known in the art for generating update packages and using them for updating versions. For example, U.S. Pat. No. 6,546,552 (“Difference extraction between two versions of data-tables containing intra-references”, published 2003) discloses a method for generating a compact difference result between an old program and a new program. Each program includes reference entries that contain references that refer to other entries in the program. According to the method of U.S. Pat. No. 6,546,552, the old program is scanned and for each reference entry the reference is replaced by a distinct label mark, whereby a modified old program is generated. In addition, according to U.S. Pat. No. 6,546,552, the new program is scanned and for each reference entry the reference is replaced by a distinct label mark, whereby a modified new program is generated. Thus, utilizing directly or indirectly the modified old program and modified new program, the difference result is generated.
WO 2004/114130 (“Method and system for updating versions of content stored in a storage device”, published 2004) discloses a system and method for generating a compact update package between an old version of content and a new version of content. The system of WO 2004/114130 includes a conversion element generator for generating a conversion element associated with the old version and new version. It also includes a modified version generator for generating a modified version, and an update package generator for generating the compact update package. The compact update package includes the conversion element and a modified delta based on the modified version and the new version.
WO 2005/003963 (“Method and system for updating versions of content stored in a storage device”, published 2005) discloses a system and method for updating versions of content stored in a storage device. The system of WO 2005/003963 includes an update module for obtaining a conversion element and a small delta. It also includes a converted old items generator for generating converted old items by applying the conversion element to items of an old version, a data entries generator for generating data entries based on the modified data entries and on the converted old item, and a new version generator for generating a new version of content by applying the commands and the data entries to the old version.
U.S. Pat. No. 6,832,373 (“System and method for updating and distributing information”, published 2004) discloses devices, systems and methods for updating digital information sequences that are comprised by software, devices, and data. In addition, these digital information sequences may be stored and used in various forms, including but not limited to files, memory locations, and/or embedded storage locations. Furthermore, the devices, systems, and methods described in U.S. Pat. No. 6,832,373 provide a developer skilled in the art with an ability to generate update information as needed and, additionally, allow users to proceed through a simplified update path, which is not error-prone, and may be performed more quickly than through the use of technologies existing when U.S. Pat. No. 6,832,373 was filed.
It is known to persons versed in the art that content is stored in a storage device, such as disk or memory. Some storage devices are organized in blocks. Also, sometimes the new version can use the same blocks previously occupying the old version. For example, if the available storage in the device is limited in space, it can be preferred to store the new version in place of the old version, saving space thereby. Such an update process, where the new version occupies at least some of the space previously occupied by the old version, is referred in the art as “in-place update”. It should be noted that hereinafter the content of a block being part of the old version is referred to as “old block” and accordingly the content of a block being part of the new version is referred to as “new block”.
One of the outcomes of this method is that once a storage block has been updated, its previous content being part of the old version is lost. A known problem in the art occurs when a process of updating an old version is interrupted in an un-orderly manner, such as the case of power failure. In case of such interruption there is a possibility that the content of the block which was being updated during the interruption may be corrupted and contain unexpected content. In the case of in-place updating, if a block becomes corrupted, then when trying to resume the process, it could be impossible to re-update the corrupted block. That is, when updating blocks of content, an old block sometimes forms part of the input used by the update process to a new. In such a case if the old block (which is corrupted) is required, the update process can not resume.
It is known the art, that in cases where storage content is being in-place updated and the process may also be subject to interruptions, the method to resolve the above problem of corrupted block is to use an auxiliary backup block and perform all block update operations by using two steps for each block. This method is also referred in the art as ‘two-phase protocol’ or ‘two-phase commit’. According to this method, in a first phase, when updating a block, the update process writes the new content to the backup block and verifies that the content is correctly stored. In a second phase, the update process copies the content of the verified backup block into its target block to form the new block. It is readily appreciated to a person versed in the art that other variations of the same method exist, such as copying the old block to the backup block in the first phase and in the second phase updating the target block to form the new block.
It is appreciated by person versed in the art that in order to resume an in-place update process it may be also required to restore some additional data that reflects the state of the process as it was before being interrupted. It is also appreciated by person versed in the art that sometimes this data can not be restored by computation, in case this data is based on content of some old blocks that were already modified. The common practice in the prior art is to maintain a record of this particular data in a storage device accessible to the update process, and to update it during the update process, to reflect its progress
It is appreciated the update procedure includes read and write operations. Using a two-phase commit procedure creates a time performance problem since the amount of read and write operations is doubled.
For example, updating the software of embedded devices such as mobile phones requires in-place updating due to the severe size constraints on its storage, especially the storage part used for holding its software. For economical reasons, mobile phones are not built to have enough storage to hold two full versions of the software and if a mobile phone is required to update its software, it is appreciated that it will require the method of in-place update.
Updating mobile phone's software is a relatively slow process due to the speed of the storage devices used (for example Flash memory). During the update process the phone is inoperable, creating the need to minimize the time it takes.